﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MyExceptions;
using System.Collections.ObjectModel;
using DataModels;

namespace HouseKeepingServices
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IServices
    {
        [OperationContract]
        int GetInt();
        [OperationContract]
        String GetString();

        [OperationContract]
        User GetUser(string Username);

        [OperationContract]
        User GetUserData(string username);

        [OperationContract]
        bool IsUsernameTaken(string username);

        [OperationContract]
        bool IsUserAuthenticated(string username, string password);

        [OperationContract]
        DataTypeBulk GetDataTypes();
        
        [OperationContract]
        ObservableCollection<ReportType> GetReportTypesAvailable();

        [OperationContract]
        ObservableCollection<ActionType> GetActionTypes();

        [OperationContract]
        ObservableCollection<UserType> GetUserTypes();

        [OperationContract]
        bool InsertUser(User user);

        [OperationContract]
        void UpdateUser(User user);

        [OperationContract]
        void DeleteUserByID(int userID);

        [OperationContract]
        void DeleteUserByUsername(string Username);

        [OperationContract]
        ObservableCollection<Income> GetIncomesForUsers(string user);

        [OperationContract]
        ObservableCollection<Outcome> GetOutcomesForUsers(string user);

        [OperationContract]
        int InsertIncome(Income income);

        [OperationContract]
        int InsertOutcome(Outcome outcome);

        [OperationContract]
        void UpdateOutcome(Outcome outcome);

        [OperationContract]
        void UpdateIncome(Income income);

        [OperationContract]
        void DeleteOutcome(int outcomeID);

        [OperationContract]
        void DeleteIncome(int incomeID);


        #region reports

        [OperationContract]
        Double GetTotalIncomeForPeriod(ReportMessage reportMessage);
        
        [OperationContract]
        Double GetTotalOutcomeForPeriod(ReportMessage reportMessage);

        [OperationContract]
        Double GetTotalBalanceForPeriod(ReportMessage reportMessage);

        [OperationContract]
        IEnumerable<Report> GetIncomesBySections(ReportMessage reportMessage);

        [OperationContract]
        IEnumerable<Report> GetOutcomesBySections(ReportMessage reportMessage);


        #endregion
    }
}
